package com.hay.oss.ftp;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ftp配置
 * @author LiMouRen
 * @date 2023/7/26
 */
@Configuration
@EnableConfigurationProperties({FtpOssProperties.class})
@ConditionalOnProperty(name = "ftp-oss.enable",havingValue = "true")
public class FtpOssConfiguration {

    @Bean
    public FtpOssTemplate ftpTemplate(FtpOssProperties ftpProperties) {
        return new FtpOssTemplate(ftpProperties);
    }

}
